package com.simple.weibo.database;

import com.simple.weibo.bean.User;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class SimpleDatabaseHelper extends SQLiteOpenHelper {


	public SimpleDatabaseHelper(Context context, String name,
			CursorFactory factory, int version) {
		super(context, name, factory, version);

	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		String sql = "create table if not exists " + User.TABLE_NAME + " ( " + User.ID
				+ " int primary key ," + User.USER_ID + " varchar,"
				+ User.ACCESS_TOKEN + " varchar," + User.ACCESS_TOKEN_SECRET
				+ " varchar," + User.ICON + " blob," + User.USER_NAME
				+ " varchar)";
		db.execSQL(sql);

	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub

	}

}
